Skip to content

ci: publish stable hastegeo wheel automatically on merge to main - #120

Merged
Joaquín Rivero (jQuinRivero) merged 2 commits into
mainfrom
v-joaquinri/ci-auto-publish-stable-wheel
Aug 11, 2026
Merged

ci: publish stable hastegeo wheel automatically on merge to main#120
Joaquín Rivero (jQuinRivero) merged 2 commits into
mainfrom
v-joaquinri/ci-auto-publish-stable-wheel

Conversation

@jQuinRivero

Copy link
Copy Markdown
Contributor

Problem

Merging a PR into main that touches hastelib/ builds and validates a wheel,
but never publishes it. Stable publication has been off since the release
pipeline shipped — the latest stable wheel is 1.0.25/1.0.26 while twelve
1.0.27rcN prereleases have accumulated on the haste-binaries release.

Nothing was failing. The build workflow is credential-free by design and did its
job; the downstream publish-stable job in hastegeo-publish.yml was simply
skipped on every merge by its own if: condition:

vars.HASTEGEO_PUBLISH_ENABLED == 'true' &&
vars.HASTEGEO_RELEASE_APPROVAL_CONFIGURED == 'true'

Neither repository variable was ever set. Behind them sat a second gate, the
protected hastegeo-release environment requiring a per-release reviewer.

Most recent example: build run
31346902355
succeeded and its publisher run
31346931090
reported prepare: success, publish-stable: skipped.

Change

Remove the redundant approval gate from publish-stable:

  • drop the HASTEGEO_RELEASE_APPROVAL_CONFIGURED clause
  • drop environment: hastegeo-release
  • keep HASTEGEO_PUBLISH_ENABLED as the kill switch

The per-release approval was a rollout mechanism (see
spec/features/hastegeo-ci-pipeline/plan.md: "Merge with publication disabled…
then enable and manually approve the first release"
), not a permanent control.
It is also redundant: the main ruleset is active with zero bypass actors
and requires an approving review, resolved review threads, CodeQL and gitleaks.
Nothing reaches main unreviewed, so a second sign-off re-approves an
already-reviewed commit.

RC deletion stays gated

HASTEGEO_RELEASE_APPROVAL_CONFIGURED is deliberately left unset. It also
guards the destructive RC-deletion job in rc-cleanup.yml, which retains the
protected hastegeo-release environment. This PR un-gates stable publication
only. test_scheduled_cleanup_is_report_only still asserts that carve-out.

Behavior change

Once HASTEGEO_PUBLISH_ENABLED=true is set (after this merges), every merge
touching hastelib/ cuts a patch release
. The next one resolves
1.0.261.0.27, publishing hastegeo-1.0.27-py3-none-any.whl and creating
tag hastegeo-v1.0.27.

Use workflow_dispatch with an explicit bump or set_version for
minor/major releases.

Security posture

Unchanged apart from the removed approval. The publisher still runs trusted
default-branch code via workflow_run, re-resolves the version from trusted
policy, revalidates the downloaded wheel before publishing, and cannot overwrite
assets (no --clobber; already_published makes reruns a no-op).

Tests

hastegeo-build.yml runs python -m unittest discover -s hastelib/tests/build
as a build step, so the policy test asserting the old gate had to be updated in
the same change — otherwise this fix would break the wheel build it is fixing.

test_rc_is_automatic_but_stable_is_approval_gated becomes
test_rc_and_stable_are_both_automatic_but_kill_switched, asserting
publish-stable has no environment:, still requires
HASTEGEO_PUBLISH_ENABLED, and no longer references
HASTEGEO_RELEASE_APPROVAL_CONFIGURED.

All 34 tests pass locally.

Follow-up after merge

Set the repository variable — stable publication stays off until then:

gh variable set HASTEGEO_PUBLISH_ENABLED --body true --repo microsoft/haste

Order matters: setting it before this merges would leave publish-stable
blocked on the environment approval and could queue a pending deployment.

Merging a PR into `main` that touches `hastelib/` produced a validated wheel
artifact but never published it. The `publish-stable` job in
`hastegeo-publish.yml` was gated on two repository variables
(`HASTEGEO_PUBLISH_ENABLED` and `HASTEGEO_RELEASE_APPROVAL_CONFIGURED`) plus the
protected `hastegeo-release` environment. Neither variable was ever set, so the
job was silently skipped on every merge and stable publication has been off since
the pipeline shipped — stable stops at 1.0.26 while twelve 1.0.27rcN prereleases
accumulated.

The per-release approval was a rollout gate, not a permanent control. It is also
redundant: the `main` ruleset is active with no bypass actors and requires an
approving review plus CodeQL and gitleaks, so nothing reaches `main` unreviewed.
The PR review that lands the commit is the release approval.

Drop the `HASTEGEO_RELEASE_APPROVAL_CONFIGURED` condition and the
`environment: hastegeo-release` line from `publish-stable`.
`HASTEGEO_PUBLISH_ENABLED` remains as the kill switch.

`HASTEGEO_RELEASE_APPROVAL_CONFIGURED` is intentionally left unset: it also
gates the destructive RC deletion job in `rc-cleanup.yml`, which keeps the
protected environment and its reviewer requirement.

Behavior change: every merge touching `hastelib/` now cuts a patch release. Use
`workflow_dispatch` with an explicit `bump` or `set_version` for minor/major.

Update the workflow policy test accordingly — `hastegeo-build.yml` runs that
suite as a build step, so leaving it asserting the old gate would break the wheel
build itself. `test_scheduled_cleanup_is_report_only` continues to assert that RC
deletion keeps the protected environment.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d383b5e1-d1c6-4f7b-b8b1-0ef6b8f69c78

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Automates stable hastegeo wheel publication after reviewed changes merge into main, retaining the repository-variable kill switch.

Changes:

  • Removes the stable-release environment approval gate.
  • Preserves approval gating for destructive RC cleanup.
  • Updates workflow policy tests and release documentation.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/hastegeo-publish.yml Enables automatic stable publication.
.github/workflows/README.md Documents release behavior and controls.
hastelib/README.md Updates the package release process.
hastelib/tests/build/test_release_workflows.py Verifies the revised publication policy.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/hastegeo-publish.yml
Comment thread .github/workflows/README.md Outdated
Address PR #120 review feedback.

The spec is the source of truth in this repo, but the workflow change left it
asserting a control that no longer exists. Update README.md, design.md, plan.md,
and test-plan.md to record that stable publication is automatic on merge to
main, gated only by HASTEGEO_PUBLISH_ENABLED, and that the protected
hastegeo-release environment plus HASTEGEO_RELEASE_APPROVAL_CONFIGURED now
scope to the destructive RC deletion job only. The superseded bring-up gate is
recorded rather than deleted.

Also remove an incorrect instruction from .github/workflows/README.md: it told
operators to use workflow_dispatch with bump/set_version for minor/major
releases, but hastegeo-publish.yml only accepts push and same-repository
pull_request upstream events, and its trusted resolver receives neither input.
That path publishes nothing. Document the gap explicitly instead.
@github-actions

Copy link
Copy Markdown

RC artifacts ready

All branch deployment references use the same RC tag:

  • hastegeo_version: 1.0.27rc13
  • training_image_tag: 1.0.27rc13
  • imageprep_image_tag: 1.0.27rc13
  • wheel: hastegeo-1.0.27rc13-py3-none-any.whl

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jQuinRivero
Joaquín Rivero (jQuinRivero) merged commit c03c6ea into main Aug 11, 2026
12 checks passed
@github-actions

Copy link
Copy Markdown

RC artifacts ready

All branch deployment references use the same RC tag:

  • hastegeo_version: 1.0.27rc14
  • training_image_tag: 1.0.27rc14
  • imageprep_image_tag: 1.0.27rc14
  • wheel: hastegeo-1.0.27rc14-py3-none-any.whl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants